PADS;++i) padTeamAssignment[i]=-1; // padTeamAssignment[0]=0; // padTeamAssignment[1]=1; fluffTeamIDs[0]=team1; fluffTeamIDs[1]=team2; for(i=0;i fluff.c // Created -> Apr 09, 1996 // Author -> Peter Ward // Description -> Misc fluff // #include "project.h" #include "drv\font.h" #include "drv\thing.h" #include "drv\pad.h" #include "drv\task.h" #include "drv\ot.h" #include "drv\cache.h" #include "drv\sprite.h" #include "drv\palette.h" #include "drv\physics.h" #include "drv\parse.h" #include "drv\actor.h" #include "drv\devapor.h" #include "drv\memory.h" #include "drv\cdrom.h" #include "drv\xa_audio.h" #include "source\fluff.h" #include "source\tfluff.h" #include "source\player.h" #include "source\goalie.h" #include "source\attrib.h" #include "source\tid.h" #include "source\puck.h" #include "source\rink.h" #include "source\team.h" #include "source\cdromdat.h" #include "source\action.h" #include "source\cam.h" #include "source\stadium.h" #include "source\score.h" #include "source\board.h" #include "source\penalty.h" #include "source\pause.h" #include "source\team.h" #include "source\file_num.h" #include "source\ai\ai.h" #include "source\ai\puckfree.h" #include "drv\problem.h" #include "source\global.h" #include "source\replay.h" #include "source\files.h" #include "source\sim.h" #include "source\fight.h" #include "drv\memcard.h" //ASL // ========================================================================= // // LOCAL CONSTANTS // // ========================================================================= // ========================================================================= // // GLOBAL VARIABLES // // ========================================================================= SCORE game_score; SCORE *Gamescore; GAMEFLUFF gameplay_fluff; char Secret_team=OFF; TASK *TaskPtr_firepuck; TASK *TaskPtr_passline; // ========================================================================= long id_message_big; long id_message_red; long id_message_offside; // ========================================================================= RECT ftex_rect[FTEX_MAX]; short ftex_pal[FTEX_MAX]; char ftex_bit[FTEX_MAX]; extern char _PERIOD_LENGTH[]; extern char *STR_PERIOD[]; // ========================================================================= // // LOCAL VARIABLES/FUNCTIONS // // ========================================================================= void Task_kill_hockey_attract(void); /////////////////////////////////////////////////////////////////////////// // // Init_fluff(void) // // Tests fluff tasks by starting them up regardless. // /////////////////////////////////////////////////////////////////////////// void Init_fluff(void) { // Spawn512(TID_FLUFF,Task_players_faces); Spawn256(TID_FLUFF,Task_scorebox); if (Humans_on_team (HOME) == TRUE || Humans_on_team(AWAY) == TRUE) { if(options[OPTION_TICKERBAR_FREQUENCY]!=0 && playMode==PLAY_MODE_SEASON && num_day_highlights>0/*|| (playMode==PLAY_MODE_PLAYOFFS*/)Spawn256(TID_FLUFF,Task_tickerbar); } Spawn64(TID_FLUFF,Task_message_attack_type); //Spawn256(TID_FLUFF,Task_net_target); // Spawn256(TID_FLUFF,Task_puck_shadow_and_highlight); // TaskPtr_passline = Spawn256(TID_FLUFF,Task_draw_passline); // Suspend_task(TaskPtr_passline); TaskPtr_firepuck = Spawn256(TID_FLUFF,Task_firepuck); if (options[OPTION_FIREPUCK] == NO) Suspend_task(TaskPtr_firepuck); // // If no humans playing, START returns to Fluff if (Humans_on_team (HOME) == FALSE) { if (Humans_on_team (AWAY) == FALSE) Spawn256(TID_FLUFF,(task_type)Task_no_humans); } gf_bottom_message_up=0; } /////////////////////////////////////////////////////////////////////////// // // Start returns to fluff & Handles Attract mode // // --pat /////////////////////////////////////////////////////////////////////////// void Task_no_humans(void) { short contr; short sleeps; short changecam; char toggle=OFF; u_short sleep_ticks; char killed; // sleeps=200*30; // sleeps = Random_min_max(45,90)*30; //45 sec - 1.5 min sleeps = Random_min_max(15,30)*30; //45 sec - 1.5 min // DEBUG //sleeps = 60*10*30; changecam = Random_min_max(10,25)*30; if (gf_game_attract_mode == YES) { short i; // // scramble goals scored this season for (i=0;i= 15) { toggle ^=1; sleep_ticks = 0; } Select_font(font7); Font_ot(hi_ot); Font_camera(NULL); Font_rgb(-48,-48,0); if (toggle) { Font_position(-32-16-48+5,-7); Font_print("DEMO MODE"); } else { Font_position(-32-16-48+5,-7); Font_print("DEMO MODE"); Font_position(-39-16-48-4,8); Font_print("PRESS START"); } Select_font(font7); Font_window(-SCREEN_WIDTH/2,-SCREEN_HEIGHT/2,SCREEN_WIDTH,SCREEN_HEIGHT); Font_rgb(0,0,0); // // attract mode if (--sleeps == 0) { Task_xfer(TID_DRAW,n64Main,Task_kill_hockey_attract); Sleep(1); } if (--changecam == 0) { Set_camera_task(camera3d,CAM_TASKS[Random_min_max(0,4)]); changecam = Random_min_max(10,25)*30; } } sleep_ticks++; Sleep(1); } } /////////////////////////////////////////////////////////////////////////// // // // void Task_kill_hockey_attract(void) // // /////////////////////////////////////////////////////////////////////////// void Task_kill_hockey_attract(void) { gameAbortedFlag = 0; //back to fluff knowing came from attract mode gf_pause = OFF; Kill_hockey(); // Never returns. } /////////////////////////////////////////////////////////////////////////// // // void Init_fluff_texture(void) // // Load fluff textures to vram. // // Remembers their VRAM location, and their PALETTE // /////////////////////////////////////////////////////////////////////////// void Init_fluff_texture(void) { #ifdef __psx__ long i; GenPtr base; GenPtr tex; char *tim_addr; long *ptr; TIM_IMAGE tim_image; GenPtr buffer; // // No decomp buffer allocated buffer.c = NULL; tex.c = base.c = Load_cdrom_file(&FLUFF_TEX); i=0; while (*tex.l) { tim_addr = base.c + *tex.l++; // // Is this a TIM or a COMPRESSED TIM? ptr = (long*) tim_addr; if (*ptr != 0x00000010) { SetFitMethod(FIT_LAST); buffer.c=allocMem(*ptr); RestoreFitMethod(); devapor (ptr,buffer.c); ptr=buffer.l; } Load_tim(ptr,&ftex_rect[i]); OpenTIM(ptr); ReadTIM(&tim_image); // // Get the TRUE display size of the tim, since our // vram always allocates in cache sized chunks ftex_rect[i].w = tim_image.prect->w; ftex_rect[i].h = tim_image.prect->h; ftex_bit[i] = tim_image.mode&7; // Get bitmode for this tim // // Get the palette the TIM was assigned. ftex_pal[i] = global_slot; i++; // // Free the DECOMP buffer (if any) if (buffer.c) { DrawSync(0); buffer.c = freeMem(buffer.c); } } #endif } void Set_ftex(void *act, char name, long ftex) { #ifdef __psx__ SPRITE *sprite; sprite = Find_sprite(act,name); if (sprite) { sprite->bit = ftex_bit[ftex]; sprite->palette = ftex_pal[ftex]; sprite->vramdisplay.x = ftex_rect[ftex].x; sprite->vramdisplay.y = ftex_rect[ftex].y; sprite->vramdisplay.w = ftex_rect[ftex].w; sprite->vramdisplay.h = ftex_rect[ftex].h; Set_frame(act,name,&SHRECTV); sprite->palette = -1; } #endif } ///////////////////////////////